﻿function now(){date=new Date();var t=date.getFullYear().toString();t+=(date.getMonth()+1).toString();t+=(date.getDate()).toString();t+=(date.getHours()).toString();t+=(date.getMinutes()).toString();t+=(date.getSeconds()).toString();t+=(date.getMilliseconds()).toString();return t;};
function getrnd()
{
	document.getElementById("rndpic").src="Plugins/RndPic.aspx?t=" + now();
};
function getmrnd()
{
	document.getElementById("rndpic").src="../Plugins/RndPic.aspx?t=" + now();
};
var mt,serviceonline;
function moving()
{
	var top=document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
	//document.title=top;
	serviceonline.style.top = (top + 100) + "px";//document.body.scrollTop + 100;
};
function resize()
{	
	var n=serviceonline.offsetWidth;
	if(n==0) n=109;
	var left=document.body.clientWidth-n;
	var newleft=1015+parseInt((document.body.clientWidth-1010)/2);
	if((newleft+n)<document.body.clientWidth) left=newleft;
	serviceonline.style.left=left + "px";
};
function closeService()
{
	if(serviceonline)
	{
		clearInterval(mt);
		if (window.removeEventListener)
		{
			window.removeEventListener("resize", resize, true);
		}
		else
		{
			window.detachEvent("onresize", resize);
		}
		//cusservice.style.display="none";
		serviceonline.parentNode.removeChild(serviceonline);
	}
	
};
var txt="";
function set(o)
{
	
	if(o.checked)
	{
		txt=frmcomment.f1.value;
		frmcomment.f1.value="匿名";
		frmcomment.f1.disabled =true;
		frmcomment.f1.style.backgroundColor="#f2f2f2";
	}
	else
	{
		frmcomment.f1.value=txt;
		frmcomment.f1.disabled =false;
		frmcomment.f1.style.backgroundColor="#ffffff";
	}
};
function Complete()
{
	serviceonline=document.getElementById("ServiceOnline");
	if(serviceonline)
	{
		resize();
		serviceonline.style.display="block";
		mt=window.setInterval("moving()",30);
		if(window.addEventListener)
		{	window.addEventListener("resize",resize, true);}
		else
		{window.attachEvent("onresize",resize);}
	}
};
if(window.addEventListener)
{	window.addEventListener("load",function(){if(typeof(Complete)=="function"){Complete();}}, false);}
else
{window.attachEvent("onload",  function(){if(typeof(Complete)=="function"){Complete();}});}